#include <unordered_map>
#include <string>
#include <iostream>

using namespace std;

int main()
{
	unordered_map<size_t, string> m1 =
	{
		{ 1, "peter"},
		{ 2, "lucy"},
		{ 3, "haha"},
		{ 4, "joy"},
		{ 5, "grater"},
	};

	unordered_map<size_t, string> m2;
	auto nh = m1.extract(2);
	m2.insert(move(nh));

	bool first = true;
	cout << "m1: ";
	for (auto pr : m1)
	{
		if (first) first = false;
		else cout << ",";

		cout << "[" << pr.first << "]" << pr.second;
	}
	cout << endl;
	first = true;
	cout << "m2: ";
	for (auto pr : m2)
	{
		if (first) first = false;
		else cout << ",";

		cout << "[" << pr.first << "]" << pr.second;
	}
	cout << endl;
	return 0;
}